<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:replace="~{main::head}">
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div class="container-fluid">
    <table class="table">
        <thead>
        <tr>
            <th>
                ID
            </th>
            <th>
                班级名称
            </th>
            <th>
                班级代码
            </th>
            <th>
                操作
            </th>
        </tr>
        </thead>
        <tbody>
        <tr th:each="cla,sat:${pageBean.arrayList}">
            <td th:text="${cla.id_class}">
                1
            </td>
            <td th:text="${cla.class_name}">
                形势与政策一班
            </td>
            <td th:text="${cla.class_number}">
                12345
            </td>
            <td>
                <a class="link-dark text-decoration-none" th:href="@{/change-class/${cla.id_class}}" th:if="${teacher}">
                    编辑
                </a>
                <a class="link-danger text-decoration-none" th:href="@{/delete-class/${cla.id_class}}"
                   th:if="${teacher}">
                    删除
                </a>
                <a class="link-danger text-decoration-none" th:href="@{/quit-class/${cla.id_class}}"
                   th:if="${student}">
                    退出班级
                </a>
            </td>
        </tr>
        </tbody>
    </table>
    <nav>

        <ul class="pagination justify-content-end">
            <li class="page-item disabled" th:class="${pageBean.current} == 1? 'page-item disabled':'page-item'">
                <a class="page-link" href="#"
                   th:href="@{class-list-pageful/15/(index=${pageBean.current}-1)}"
                   tabindex="-1"
                   aria-disabled="true">上一页</a>
            </li>

            <li class="page-item" th:each="index:${#numbers.sequence(1,pageBean.totalPage)}">
                <a class="page-link" href="#"
                   th:href="@{class-list-pageful/15/(index=${pageBean.current}-1)}"
                   th:text="${index}">1</a>
            </li>
            <!--/*-->
            <li class="page-item"><a class="page-link" href="#">2</a></li>
            <li class="page-item"><a class="page-link" href="#">3</a></li>
            <!--*/-->
            <li class="page-item"
                th:class="(${pageBean.current} eq ${pageBean.totalPage})?'page-item disabled':'page-item'">
                <a class="page-link" href="#"
                   th:href="@{class-list-pageful/15/(index=${pageBean.current}+1)}">下一页</a>
            </li>
        </ul>
    </nav>

</div>

</body>
</html>